package com.jeff.android.lab.bugs;

import com.jeff.android.lab.BaseRecyclerViewFragment;
import com.jeff.android.lab.bugs.toast.ToastBugFragment;
import com.jeff.android.lab.util.RouterUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: dingfeng
 * @date: 2020-04-14
 * @since: 1.0.0
 **/
public class BugsMainFragment extends BaseRecyclerViewFragment {

    @Override
    protected List<String> getData() {
        return new ArrayList<String>() {
            {
                /**
                 * android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@5d16564 is not valid; is your activity running?
                 * */
                add("toast"); // Android 7.1.1 7.1.2 异常
            }
        };
    }

    @Override
    protected void launch(String widget) {
        if ("toast".equals(widget)) {
            RouterUtil.launchFragmentActivity(getContext(), ToastBugFragment.class);
        }
    }

}
